<%@ include file="base.jsp" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ page import="net.amsoft.iservice.isso.util.ISSOConstants"%>
<%@ page import="net.amsoft.iservice.isso.hibernate.IBroker" %>
<%@ page import="net.amsoft.iservice.isso.service.ISSOService" %>
<%
	// Service URLs
	String contactURL = "#";
	String forwardingURL = "#";
	
	// Get IBroker Data
	IBroker oIBroker = ISSOService.getIBroker(request.getServerName());
	if (oIBroker!=null)
	{
		String synonym = oIBroker.getContactURL();
		contactURL = synonym.substring(0, synonym.lastIndexOf('/'));
		synonym = oIBroker.getForwardingURL();
		forwardingURL = synonym.substring(0, synonym.lastIndexOf('/'));
		System.out.println("contactURL -> " + contactURL);
		System.out.println("forwardURL -> " + forwardingURL);
	}

%>

<html>
<head>
<script src="js/help.js"></script>
<SCRIPT LANGUAGE="JavaScript">
	<!--
	function formSubmit(formName)
	{
			
		if(formName == 'forgot')
		{
			document.ForgotForm.submit();
		}
		else
		{
			document.LoginForm.submit();
		}
	}
	
	//-->
	</SCRIPT>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title><bean:message key="title.password" /></title>
<link rel="stylesheet" type="text/css" href="styleSheets/iservices.css" />
</head>

<body onload="document.LoginForm.password.focus();">
<center>
<table cellspacing=25 border=0 cellpadding=0>
	<%@ include file="leftMenu.jsp" %>
		<td width=605 valign=top>
		<form name="LoginForm" action="/isso/Authenticate" method="post">
		<table border=0 cellspacing=0 cellpadding=0 width=100%>
<tr><td align="left" colspan="2" height="23px"><img src="<%=imagePath%>/tab-click-isso.jpg" border="0" height="23px" onmouseover="this.src='<%=imagePath%>/tab-rollover-isso.jpg'" onmouseout="this.src='<%=imagePath%>/tab-click-isso.jpg'" /><a href="<%=contactURL%>"><img src="<%=imagePath%>/tab-noclick-contact.jpg" border="0" height="23px" onmouseover="this.src='<%=imagePath%>/tab-rollover-contact.jpg'" onmouseout="this.src='<%=imagePath%>/tab-noclick-contact.jpg'" /></a><a href="<%=forwardingURL%>"><img src="<%=imagePath%>/tab-noclick-forwarding.jpg" border="0" height="23px" onmouseover="this.src='<%=imagePath%>/tab-rollover-forwarding.jpg'" onmouseout="this.src='<%=imagePath%>/tab-noclick-forwarding.jpg'" /></a></td></tr>
			<tr>
				<td width="270" valign="top">
				<table border="0" cellpadding="0" cellspacing="0" width="270">
					<tr height="45">
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
						<td width="270" bgcolor="#999999"><img src="<%=imagePath%>/title_isso_login.gif" /></td>
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					</tr>						
					<tr height="10">
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
						<td width="270" bgcolor="#CCCCCC">
						<table border="0" cellpadding="0" cellspacing="0" width="270">
							<tr>
				                <td width="10px"></td>
				                <td width="10px"></td>
				                <td width="10px"></td>
				            </tr>    
				            <bean:define id="samlData" name="SPData" property="SAMLData" scope="request"/>
				            
				            <logic:equal name="samlData" property="passive" value="true">
								<tr>
					                <td width="10px"></td>
					                <td class="black-smalltext"><bean:message
					                    key="msg.requesting.provider" /><b> <bean:write name="samlData"
					                    property="providerName" /></b>
					                </td>
					            </tr>  
							</logic:equal>
						 
				            <tr>
								<td width="10">&nbsp; </td>
								<td colspan="1" class="black-smalltext">
				                    <% String obj = (String)request.getSession().getAttribute(ISSOConstants.SESSION_SHOW_GREETING);
				                      if (obj!= null && obj.equals("true")){
				                      	String greeting = (String)request.getSession().getAttribute(ISSOConstants.REQ_ATTRIB_GREETING);
				                      	if (greeting!= null ){
					                   %> <bean:message key="label.personal.greeting" /> <img src="<%=imagePath%>/mark-before-greeting.jpg" /><%=greeting%><img src="<%=imagePath%>/mark-after-greeting.jpg" />
					                   <%}else {} }%>
				                 </td>
							</tr>
							<tr>
							<td width="10">&nbsp; </td>
								<td colspan="1" >
								<%if (obj!= null && ((String)obj).equals("true")){
									String greeting = (String)request.getSession().getAttribute(ISSOConstants.REQ_ATTRIB_GREETING);
				                      	if (greeting!= null ){
									%> <font class="blue-smalltext"><bean:message key="label.what.is.greeting" /></font>
									<a class="link-nounderline blue-xsmalltext" onmouseover="showHelp('<bean:message key='label.help.personalgreetingtitle'/>','<bean:message key='label.help.personalgreetingmsg' />');" ><img src="<%=imagePath%>/help-bullet.jpg" /></a>
									<%}else {} }%>
				                </td>
							</tr>
							<tr>
				                <td width="10px"></td>
								<td ><font class="blue-smalltext"><b><html:errors /></b></font></td>
							</tr>
							<tr>
				                <td width="10px"></td>
								<td ><font class="blue-smalltext"><bean:message key="label.enter.password" /></font></td>
							</tr>
							<tr>
								<td height="8px" colspan="2" valign="bottom"><img height="2px"
									src="<%=imagePath%>/dotted-line.gif" /></td>
							</tr>
							<tr>
								<td height="8px" colspan="2"></td>
							</tr>
							<tr>
								<td width="10px"></td>
								<td height="32px" class="black-smalltext"><bean:message
									key="label.userpassword" /> <input type="password" name="password"
									size="22" maxlength="20" class="textbox">&nbsp; <input type="image"
									src="<%=imagePath%>/button-submit.jpg" name="submit_btn"
									onclick="LoginForm.submit();" align="middle" alt="submit"></td>
							</tr>
							<tr>
								<td width="10px"></td>
								<td height="32px" class="black-smalltext">
								<a href="/isso/ForgotPassword">
								<img src="<%=imagePath%>/button-forgot-password.jpg" border="0" alt="Forgot password"/></a>
								</td>
							</tr>
							<tr>
								<td width="10px"></td>
								<td height="30px" class="black-smalltext"><input type="checkbox"
									name="rememberMachine" checked value="true">&nbsp;<bean:message
									key="label.checkbox.remembermachine" /></td>
							</tr>
							<!--
							<tr>
								<td height="2px" colspan="2"><img
									src="<%=imagePath%>/dotted-line.gif" /></td>
							</tr>
							-->
							<tr>
								<td height="33px" colspan="2"></td>
							</tr>
							<tr>
								<td height="35px" colspan="2"></td>
							</tr>
							<tr>
								<td width="10px"></td>
							</tr>
							<tr>
								<td><input type="hidden" name='<%=ISSOConstants.REQ_PARAM_SPXRI%>'  value='<%=request.getAttribute(ISSOConstants.REQ_PARAM_SPXRI)%>'></td>
							</tr>
						</table>
						</td>
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					</tr>				
					<tr height="10">
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
						<td width="270" bgcolor="#999999"></td>
						<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					</tr>						
				</table>
				</td>
				<td width=25><img src="<%=imagePath%>/white-square.gif" /></td>
				<td width=270 height="304" valign=top><img
					src="<%=imagePath%>/related-news.gif?<%=dt.getTime()%>" width="270" height="304" /><br>
				</td>
			</tr>
			
		</table>
		</form>
		<form name="helpForm">
			<input name='imagePath' type='hidden' value='<%=imagePath%>' />
			<DIV id="help" class="helpbox"></DIV>
		</form>
		</td>
	</tr>
</table>
</center>
</body>
</html>
